﻿@model IEnumerable<MLManagement.Models.Product>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var grid = new WebGrid(Model, defaultSort: "ProductId", rowsPerPage: 50);
}
<div class="well">
    <h3>
        <p class="muted">
            Productos</p>
    </h3>
</div>
<p>
    @using (Html.BeginForm())
    {
        <input class="btn btn-info" type="submit" name="submit" value="Agregar Producto" />      
        <input class="btn btn-info" type="submit" name="submit" value="Hacer Pedidos de Productos" />      
        <input class="btn btn-info" type="submit" name="submit" value="Pedidos Realizados" />  
        <div class="pull-right">
            Buscar
            <input type="text" class="search-query" name="searchCriteria" />
            <input class="btn btn-info" type="submit" name="submit" value="Buscar Producto" />
        </div>
         
    }
</p>

@grid.GetHtml(
        tableStyle: "well",
        alternatingRowStyle: "alert alert-info",
        columns: grid.Columns(
        grid.Column(null, "Id", format: p => Html.ActionLink((string)p.ProductId.ToString(), "Details", new { id = p.ProductId }),style:"width:40px;"),
                        grid.Column("Brand", "Marca",style:"width:200px;"),
                        grid.Column("Model", "Modelo", style: "width:200px;"),
                        grid.Column("LogicalStock", "Stock Disponible ",style:"width:100px;"),
                        grid.Column("PhysicalStock", "Stock Físico", style: "width:100px;"),
                            grid.Column(format: item => Html.Raw(Html.ActionLink("Editar", "Edit", new { id = item.ProductId }) + " | " + Html.ActionLink("Eliminar", "Delete", new { id = item.ProductId })))
                    )

    )